/**
 * Description:
 * Created by Administrator on 2016/10/22.
 */
var Ball = function (radius, color) {
    this.x = 0;
    this.y = 0;
    this.vx = 0;
    this.vy = 0;
    if (radius === undefined) radius = 20;
    if (color === undefined) color = '#ff5001';
    this.rotation = 0;
    this.lineWidth = 1;
    this.radius = radius;
    this.color = color;
    this.scaleX = 1;
    this.scaleY = 1;
}
Ball.prototype.draw = function (context) {
    context.save();
    context.translate(this.x, this.y);
    context.rotate(this.rotation);
    context.lineWidth = this.lineWidth;
    context.fillStyle = this.color;
    context.strokeStyle = this.color;
    context.scale(this.scaleX, this.scaleY);
    context.beginPath();
    context.arc(0, 0, this.radius, 0, Math.PI * 2, false);
    context.closePath();
    context.fill();
    context.stroke();
    context.restore();
}